package cc;

public abstract class Animal {
    //添加abstract之后的类是抽象类
    //这里是动物的父类

    private String name;
    private int age;
    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    //抽象方法
    //在调用的时候需要覆写
    //抽象方法定义的时候不需要写函数主体
    public abstract void move();


    public void makeSound() {
        System.out.println("All animals Sounds has happen!!");
    }

    public void displayInfo(){
        System.out.println("Name: " + name);
        System.out.println("Age: " + age);
    }

    public int getAge() {
        return age;
    }

    public void brithday(){
        age++;
        System.out.println("Brithday!!");
    }

}
